package com.ruibang.glass.quality.controller.data;

import com.ruibang.glass.quality.domain.req.DefectLossReq;
import com.ruibang.glass.quality.domain.req.EveryHourDefectLossReq;
import com.ruibang.glass.quality.service.EveryHourDefectLossService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 每小时缺陷损失数据 前端控制器
 * </p>
 *
 * @author wujie
 * @since 2020-08-06
 */
@RestController
@RequestMapping("/api/everyHour/loss")
@Api(value="每小时缺陷损失数据",tags={"每小时缺陷损失数据"})
public class EveryHourDefectLossController {

    
    @Autowired
    private EveryHourDefectLossService everyHourDefectLossService;


    @PostMapping("/queryEveryHourDefectLoss")
    @ApiOperation(value="每小时缺陷损失数据",notes="每小时缺陷损失数据")
    public ResultBody queryEveryHourDefectLoss(@RequestBody EveryHourDefectLossReq everyHourDefectLossReq){
        return everyHourDefectLossService.queryEveryHourDefectLoss(everyHourDefectLossReq);
    }


    @PostMapping("/queryStoneLoss")
    @ApiOperation(value="结石总损失率",notes="结石总损失率")
    public ResultBody queryStoneLoss(@RequestBody DefectLossReq defectLossReq){
        return everyHourDefectLossService.queryStoneLoss(defectLossReq);
    }

    @PostMapping("/queryBubbleLoss")
    @ApiOperation(value="气泡总损失率",notes="气泡总损失率")
    public ResultBody queryBubbleLoss(@RequestBody DefectLossReq defectLossReq){
        return everyHourDefectLossService.queryBubbleLoss(defectLossReq);
    }

    @PostMapping("/queryPlatinumLoss")
    @ApiOperation(value="铂金总损失率",notes="铂金总损失率")
    public ResultBody queryPlatinumLoss(@RequestBody DefectLossReq defectLossReq){
        return everyHourDefectLossService.queryPlatinumLoss(defectLossReq);
    }

    @PostMapping("/queryTotalLoss")
    @ApiOperation(value="总损失图",notes="总损失图")
    public ResultBody queryTotalLoss(@RequestBody DefectLossReq defectLossReq){
        return everyHourDefectLossService.queryTotalLoss(defectLossReq);
    }
}
